<template>
<div>
	<x-header>待办事项 <router-link to="/" slot="right"> <a class="fa fa-home fa-15x"></a> </router-link></x-header>
	<div>
		<ab-scroller url="/bpm/my/todoTaskList?supportMobile$V=true" noDataText="没有更多移动端可办理的任务了" :conditions="conditions">
			<div slot-scope="slotScope">
				<!-- <cell v-for="task in slotScope.rows" :key="task.id" :value="formatDate(task.createTime)" :title="task.name"  :link="{path:'/bpm/complateTask',query:{taskId: task.id}}" :inline-desc="task.subject"></cell> -->
				<div v-for="task in slotScope.rows" :key="task.id" >
					<router-link :to="{path:'/bpm/complateTask',query:{taskId: task.id}}">
						<div class="gz-card gz-list-style">
							<div class="title-box">
							<slot name="title">
								<div class="card-item">
									<div class="card-item" style="flex: 1;">
										<div class="item-title">创建时间：</div>
										<div class="item-value">{{task.createTime}}</div>
									</div>
								</div>
							</slot>
							<div class="left-dot"></div>
							<div class="right-dot"></div>
							</div>
							<div class="content-box">
							<slot name="content">
								<div class="card-items">
									<div class="card-item" style="flex: 1;">
										<div class="item-title">任务标题：</div>
										<div class="item-value">{{task.name}}</div>
									</div>
									<div class="card-item" style="flex: 1;">
										<div class="item-title">任务名称：</div>
										<div class="item-value">{{task.subject}}</div>
									</div>
								</div>
							</slot>
							</div>
							<div class="footer-box">
							<slot name="footer">
								<div class="btn-group">
									<div class="btn btn-primary">办理</div>
								</div>
							</slot>
							</div>
						</div>
					</router-link>
				</div>
			</div>
		</ab-scroller>
	</div>
</div>
</template>

<script>

import Vue from 'vue';

export default {
	data: function () {
	  return {
		  tasks:[],
		  conditions:[{key:"subject_^VLK",value:"流程标题"},{key:"task.name_^VLK",value:"任务名称"}]
	  }
	},
	created : function(){
	},
	methods: {	   
		formatDate:function(day){
			if(!day)return '';
			if(day.length>10){
				return day.substring(0,10);
			}
			
			var now = new Date(day); 
			return now.format("yyyy-MM-dd"); 
			 
		}
	}
}
</script>
<style scoped lang="less">
	/deep/._v-container{
		border-top: 0.5em solid rgba(0,0,0,0) !important;
	}
</style>
